/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024.
 * Description: fast notify for hpvisor
 * Author: liwugui <liwugui1@huawei.com>
 * Create: 2024-04-20
 */

#ifndef UM_HPVISOR_VNOTIFY_H
#define UM_HPVISOR_VNOTIFY_H

#include <linux/types.h>
#include <linux/task_struct_extend.h>
#include "vnotify.h"

#define UM_VNOTIFY_IPI_NUM 7

#define EFD_CHN_SHARED	(1 << 0)
#define EFD_CHN_EPIPED	(1 << 1)
#define EFD_CHN_FAST	(1 << 2)

static inline void hpvisor_wake_up_all(struct wait_queue_head *wq_head, __poll_t event)
{
	__wake_up(wq_head, TASK_NORMAL, INT_MAX, poll_to_key(event));
}

/* for um mode */
extern bool vnotify_um_mode(void);
void um_vnotify_handler(void);
void vnotify_chn_set_cpu(u32 id);
extern void um_vnotify_send_ipi(int cpu);

#endif /* UM_HPVISOR_VNOTIFY_H */
